
sentence="Python is awesome.123123123Python is dynamic."
source_list=[1,2,3]
print("异常处理  try except else finally")
try:
    # print(sentence.index("xxx"))
    # print(sentence.index("123"))
    print(source_list.index(2))
    print(source_list.index(5))
except Exception:
    print("发生异常时执行这段代码")
else:
    print("没有异常时执行这段代码")
finally:
    print(source_list[5:])
    print("不管有没有异常都执行这段代码")

